package com.nerve.secondhandcar.service;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.multipart.MultipartFile;

import com.nerve.secondhandcar.common.bean.ImageResult;
import com.nerve.secondhandcar.controller.model.PictureModel;
import com.nerve.secondhandcar.domain.Picture;

/**
 * 平台中的图片资源Service接口
 * @author 集成显卡
 * @version 2014-10-10 10:56:05
 */
public interface PictureService {
	public Picture addDo(Picture bean);
	
	public void create(PictureModel model)throws Exception;
	/**
	 * 删除实体
	 * @param model
	 * @throws Exception
	 */
	public void delete(PictureModel model, HttpServletRequest req)throws Exception;
	
	/**
	 * 刷新实体
	 * @param model
	 * @throws Exception
	 */
	public void refresh(PictureModel model)throws Exception;
	
	/**
	 * 浏览详情
	 * @param model
	 * @throws Exception
	 */
	public void view(PictureModel model)throws Exception;
	
	/**
	 * 分页浏览
	 * @param model
	 * @throws Exception
	 */
	public void list(PictureModel model)throws Exception;
	
	/**
	 * 判断实体是否存在
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public boolean isExist(PictureModel model)throws Exception;
	
	/**
	 * 处理上传的图片
	 * 根据ImageResult中的设置进行压缩或者删除缩略图
	 * @method name: dealUploadImage
	 * @return type: void
	 *	@param req
	 *	@param mFile
	 *	@param imgResult
	 *	@throws Exception
	 */
	public void dealUploadImage(HttpServletRequest req	,MultipartFile mFile, ImageResult imgResult, Picture pic) throws Exception;
	
	public void sort(PictureModel model) throws Exception;
}